package musics;

import javazoom.jl.decoder.JavaLayerException;
import javazoom.jl.player.Player;
import javazoom.jl.decoder.JavaLayerException;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class MusicPlayer{
    public long time = 0;
    public String musicPath;
    public MusicPlayer(String musicPath){
        this.musicPath=musicPath;
    }
    public void run() throws FileNotFoundException, JavaLayerException {
        File file = new File(musicPath);
        FileInputStream  fis = new FileInputStream(file);
        BufferedInputStream stream = new BufferedInputStream(fis);
        Player player = new Player(stream);
        player.play();
    }
}
